package org.example.service;

import jdk.internal.dynalink.support.ClassMap;
import org.example.dao.ClassesMapper;
import org.example.entity.ClassEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ClassServiceImpl implements ClassService{
    @Autowired
    private ClassesMapper classesMapper;

    @Override
    public int addClass(ClassEntity classEntity) {
        return classesMapper.insertClass(classEntity);
    }

    @Override
    public List<ClassEntity> findClass(String classid) {
        return classesMapper.queryClassesByClassid(classid);
    }

    @Override
    public int chooseClass(String schoolid, String classid) {
        return classesMapper.chooseClass(schoolid,classid);
    }

    @Override
    public List<Map<String, Object>> queryStudentClass(String schoolid) {
        return classesMapper.queryStudentClass(schoolid);
    }

    @Override
    public List<Map<String, Object>> queryTeacherClass(String schoolid) {
        return classesMapper.queryTeacherClass(schoolid);
    }

    @Override
    public ClassEntity queryClass(String classid) {
        return classesMapper.queryClass(classid);
    }

    @Override
    public int updateToAudit(String classid, String schoolid) {
        return classesMapper.updateToAudit(classid,schoolid);
    }
}
